package com.budwk.app.sqfwV2.generator.povertyMonitoring;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.budwk.app.sqfwDoc.codeGeneratorV2.fileParam.ExcelGenerateParam;
import com.budwk.app.sqfwDoc.codeGeneratorV2.fileParam.ExcelRowDataParam;
import com.budwk.app.sqfwDoc.codeGeneratorV2.generate.BaseExcelGenerator;
import com.budwk.app.sqfwDoc.codeGeneratorV2.generate.ResultOfExcelDataInto;
import com.budwk.app.sqfwV2.enums.povertyMonitoring.FormingMaterialEnum;
import com.budwk.app.sqfwV2.enums.povertyMonitoring.QuarterEnum;
import com.budwk.app.util.poiUtils.excelPictureConfigBO.ExcelFileCreateParamBO;
import org.apache.commons.lang3.ObjectUtils;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author zhangp
 * @date 2024-06-17
 */
public class FamilyMembersWorksExcelGenerator extends BaseExcelGenerator {

    @Override
    protected void customerPopularHeaderData(Map<String, Object> excelParam, ExcelGenerateParam excelGenerateParam) {
        if(ObjectUtils.isNotEmpty(excelGenerateParam.getCustomerParamMap())){
            String quarter=null;
            if(excelGenerateParam.getCustomerParamMap().containsKey("quarter")){
                QuarterEnum quarterEnum = QuarterEnum.getQuarterEnumByNum(excelGenerateParam.getCustomerParamMap().get("quarter"));
                if(ObjectUtils.isNotEmpty(quarterEnum)){
                    quarter=quarterEnum.getName();
                }
            }
            excelParam.put("quarter",quarter);
            excelParam.put("year",excelGenerateParam.getCustomerParamMap().get("year"));
        }
    }

    @Override
    protected void customerPopularHeaderDataForAdmin(Map<String, Object> excelParam, ExcelGenerateParam excelGenerateParam) {

    }

    @Override
    protected ResultOfExcelDataInto judgeExcelHaveDataBeforeErgodic(Map<String, Object> excelParam, ExcelGenerateParam excelGenerateParam) {
        return null;
    }

    @Override
    protected boolean addRowDataCondition(ExcelRowDataParam rowDataParam, ExcelGenerateParam excelGenerateParam) {
        return true;
    }

    @Override
    protected void customerPopularSheetData(List<Map<String, Object>> listMap, ExcelGenerateParam excelGenerateParam) {
    }

    @Override
    protected void customerPopularRowDataMap(Map<String, Object> rowDataMap, ExcelRowDataParam rowDataParam) {

    }

    @Override
    protected void customerPopularRowDataMapForAdmin(Map<String, Object> rowDataMap, ExcelRowDataParam rowDataParam) {

    }

    @Override
    protected ResultOfExcelDataInto judgeExcelHaveDataBeforeCreate(Map<String, Object> excelParam, ExcelGenerateParam excelGenerateParam) {
        return null;
    }

    @Override
    protected String getTemplatePath(ExcelGenerateParam excelGenerateParam) {
        return FormingMaterialEnum.getTemplate(Integer.parseInt(excelGenerateParam.getExcelConfig().getFileIdentity()));
    }

    @Override
    protected String getDownloadFileName(ExcelGenerateParam excelGenerateParam) {
        return FormingMaterialEnum.getFileName(Integer.parseInt(excelGenerateParam.getExcelConfig().getFileIdentity())) + "_" + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_FORMAT);
    }

    @Override
    protected Class<?> getImageConfigBO() {
        return null;
    }

    @Override
    protected void completeExcelFileCreateParam(ExcelFileCreateParamBO excelFileCreateParamBO) {

    }
}
